Add snwhiteopt to mapsource.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Wed, 14 Apr 2004 16:42:37 +0000 (16:42 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Wed, 14 Apr 2004 16:42:37 +0000 (16:42 +0000)
gpsbabel/mapsource.c

index 879d4c928409dfd39beceb673ca981cb82042023..8305184ad36eba5af19d21e8af819b4a861292e1 100644 (file)
@@ -60,6 +60,7 @@ static void *read_route_wpt_mkshort_handle;
 #define DEFAULTICONVALUE               18
 
 char *snlen;
+char *snwhiteopt;
 char *mpsverout;
 char *mpsmergeout = NULL;
 char *mpsusedepth = NULL;
@@ -68,6 +69,8 @@ char *mpsuseprox = NULL;
 static
 arglist_t mps_args[] = {
        {"snlen", &snlen, "Length of generated shortnames", ARGTYPE_INT },
+       { "snwhite", &snwhiteopt, "(0/1) Allow whitespace synth. shortnames",
+               ARGTYPE_BOOL},
        {"mpsverout", &mpsverout, "Version of mapsource file to generate (3,4,5)", ARGTYPE_INT },
        {"mpsmergeout", &mpsmergeout, "Merge output with existing file", ARGTYPE_BOOL },
        {"mpsusedepth", &mpsusedepth, "Use depth values on output (default is ignore)", ARGTYPE_BOOL },
@@ -1819,7 +1822,11 @@ mps_write(void)
        mkshort_handle = mkshort_new_handle();
 
        setshort_length(mkshort_handle, short_length);
-       setshort_whitespace_ok(mkshort_handle, 0);
+
+       if (snwhiteopt)
+               setshort_whitespace_ok(mkshort_handle, atoi(snwhiteopt));
+       else
+               setshort_whitespace_ok(mkshort_handle, 0);
 
        mps_fileHeader_w(mps_file_out, mps_ver_out);